<?php
session_start();
if(isset($_SESSION['admin_id'])) {
    include "../include/dbFunctions.php";
    $id= $_GET['id'];
    $query0 = "DELETE FROM track_detail WHERE track_id = $id";
    $result0 = executeQuery($query0);
    $query1 = "DELETE FROM track_criteria WHERE track_id = $id";
    $result1 = executeQuery($query1);
    if (($result1!=0)) {
        $_SESSION['mes']="The tracking criteria has been removed successfully.";
    } else {
        $_SESSION['mes']="Error! Please try again";
    }
    $link = "trackView.php";

    header("Location: $link");
}else {
    header("Location: ../include/login.html");
}
?>